﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using System.Web;
using Easy.BLL;
using Easy.Operation.Data;

namespace Easy.Web.Service.Data
{
    /// <summary>
    /// GetEntityField 的摘要说明
    /// </summary>
    public class GetEntityField : BaseHttpHandler
    {

        public override void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            string entityName = context.Request["entityname"];

            string viewName = context.Request["viewname"];

            Dictionary<string, object> result = new Dictionary<string, object>();

            PageView pv = new PageView(entityName, this.GetSystemUser(), viewName);

            result.Add("Fields", pv.Fields);
            result.Add("Options", pv.Options);
            result.Add("Views", pv.ViewsPC);
            //result.Add("AllFields", pv.FieldsAll);


            context.Response.Write(JsonConvert.SerializeObject(result));
        }

      
    }
}